#pragma once

#include <unordered_map>
#include <string>
#include <easyhook.h>

#ifdef _WIN64
#pragma comment(lib,"EasyHook64.lib")
#else
#pragma comment(lib,"EasyHook32.lib")
#endif

class Hooker {
public:
	Hooker();
	~Hooker();
	void destroy();

	std::pair<bool,NTSTATUS> installHook(std::string const& moduleName,
										 std::string const& procName,
										 void* hookProc,
										 bool loadModule = false);

	std::pair<bool,NTSTATUS> activateHook(std::string const& procName,
										  bool exclusive = true);

private:
	std::unordered_map<std::string,HMODULE> modulesHandles_;
	std::unordered_map<std::string,TRACED_HOOK_HANDLE> hookHandlesMap_;
	ULONG ACLEntries_[1];

	HMODULE loadModule_(std::string const& name);
};